package com.rockwell.sniffyhunter;

import com.rockwell.sniffyhunter.R;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class MainActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle item selection
		switch(item.getItemId()) {
			case R.id.action_settings:
				changeSettings(item.getActionView());
				return true;
			default:
				return super.onOptionsItemSelected(item);
		}
	}
	
	public void startMission(View v) {
		Intent intent = new Intent(this, RobotActivity.class);
		startActivity(intent);
	}
	
	public void startMaintenance(View v) {
		Intent intent = new Intent(this, MaintenanceActivity.class);
		startActivity(intent);
	}
	
	public void startTeach(View v) {
		Intent intent = new Intent(this, TeachActivity.class);
		startActivity(intent);
	}
	
	public void definePath(View v) {
		Intent intent = new Intent(this, MazeActivity.class);
		startActivity(intent);
	}
	
	public void changeSettings(View v) {
		Intent intent = new Intent(this, SettingsActivity.class);
		startActivity(intent);
	}

	public void testModbus(View v) {
		Intent intent = new Intent(this, ModbusActivity.class);
		startActivity(intent);
	}
}
